package com.example.api.mall.demo.domain;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @name: AsyncThread
 * @description: 用于测试@Async注解
 * @author: xw.s
 * @date: 2021/6/15-10:32
 */
@Component
@Slf4j
public class AsyncThread {

    @Async("asyncTaskExecutor")
    public void say() throws InterruptedException {
        log.info("@Async方法执行开始");
        Thread.sleep(3000);
        log.info("@Async方法执行结束");
    }
}
